package com.googlecode.kipler.satisfiability.completion.rule.individual.uniformnotation;

import com.googlecode.kipler.syntax.LTLUnaryOperator;
import com.googlecode.kipler.syntax.concept.Concept;
import com.googlecode.kipler.syntax.concept.LTLUnaryConcept;


public class SometimeBetaConcept implements BetaConcept {

	private LTLUnaryConcept unCon;

	private Concept beta1, beta2;

	private boolean valid;

	public SometimeBetaConcept() {
		super();
	}

	public SometimeBetaConcept(Concept concept) {
		setBeta(concept);
	}	

	@Override
	public Concept getBeta() {
		return unCon;
	}

	@Override
	public void setBeta(Concept concept) {
		valid = false;
		if (concept instanceof LTLUnaryConcept) {
			unCon = (LTLUnaryConcept) concept;
			if (unCon.getConstructor() == LTLUnaryOperator.SOMETIME) {
				beta1 = unCon.getOperand();
				beta2 = new LTLUnaryConcept(LTLUnaryOperator.NEXT, unCon);
				valid = true;
			}
		}
	}

	@Override
	public Concept getBeta1() {
		return beta1;
	}

	@Override
	public Concept getBeta2() {
		return beta2;
	}

	public boolean isValid() {
		return valid;
	}

}
